package com.zp.datax.service.impl;

import com.zp.datax.core.model.DataxJobTrigger;
import com.zp.datax.dao.DataxJobTriggerDao;
import com.zp.datax.service.DataxJobTriggerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DataxJobTriggerServiceImpl implements DataxJobTriggerService {

    @Resource
    private DataxJobTriggerDao dataxJobTriggerDao;

    @Override
    public List<DataxJobTrigger> searchAll() {
        return dataxJobTriggerDao.findAll();
    }

    @Override
    public void add(DataxJobTrigger dataxJobTrigger) {
        dataxJobTriggerDao.save(dataxJobTrigger);
    }

    @Override
    public void update(DataxJobTrigger dataxJobTrigger) {
        dataxJobTriggerDao.update(dataxJobTrigger);
    }

    @Override
    public DataxJobTrigger searchBySysId(Integer taskId) {
        return dataxJobTriggerDao.load(taskId);
    }

    @Override
    public void remove(Integer taskId) {
        dataxJobTriggerDao.remove(taskId);
    }
}
